lib/repo: Allow disabling lock timeout
authorMatthew Leeds <matthew.leeds@endlessm.com>
Fri, 28 Sep 2018 01:07:51 +0000 (18:07 -0700)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 28 Sep 2018 15:49:11 +0000 (15:49 +0000)
commit0c8a6d64edcbc137d870f2e36ad40d2a8023c857
tree8ec6571c2141b2d36d4ccc1cc7d5f67b0f68085e
parent9a06c5409ec551a56fa1ad137efcd1f2d7044496
lib/repo: Allow disabling lock timeout

Currently the locking code checks if the value -1 was set for the config
key "lock-timeout-secs" and if so, a thread trying to acquire a lock
will block indefinitely. Positive values specify how long to attempt to
acquire a lock in a non-blocking way (the attempt is made once every
second). But when the value is read from the config file,
g_ascii_strtoull() is used, which converts it to an unsigned integer.
This commit makes libostree use g_ascii_strtoll() instead, so that it's
possible to set that key to -1 as intended.

Closes: #1737
Approved by: jlebon
src/libostree/ostree-repo.c